
point_test.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <point_1>:
#include <stdio.h>

int point_1(void)
{
   0:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
   4:	910003fd 	mov	x29, sp
	char* str = "ABCDEFGHIJKL";
   8:	90000000 	adrp	x0, 0 <point_1>
   c:	91000000 	add	x0, x0, #0x0
  10:	f9000fa0 	str	x0, [x29, #24] ; str
    int* pInt = (int*)str;
  14:	f9400fa0 	ldr	x0, [x29, #24] ; str
  18:	f9000ba0 	str	x0, [x29, #16] ; pint

    printf("%c\n%c\n",*(str+1),*(char *)(pInt+1));	// B	E
  1c:	f9400fa0 	ldr	x0, [x29, #24]           ; str
  20:	91000400 	add	x0, x0, #0x1             ; x0 = str+1
  24:	39400000 	ldrb	w0, [x0]             ; w0 = str[1] = *(str+1)
  28:	2a0003e1 	mov	w1, w0                   ; w1 = *(str+1)
  2c:	f9400ba0 	ldr	x0, [x29, #16]           ; x0 = pint
  30:	91001000 	add	x0, x0, #0x4             ; x0 = pint+4 = pint+sizeof(int)
  34:	39400000 	ldrb	w0, [x0]             ; w0 = *(pint+1) = *(pint + sizeof(int))
  38:	2a0003e2 	mov	w2, w0                   ; w2 = *(pint+1) = E
  3c:	90000000 	adrp	x0, 0 <point_1>
  40:	91000000 	add	x0, x0, #0x0
  44:	94000000 	bl	0 <printf>

	printf("%c\n", *(char *)(pInt+2));	// I
  48:	f9400ba0 	ldr	x0, [x29, #16] ; pint
  4c:	91002000 	add	x0, x0, #0x8   ; pint + 8
  50:	39400000 	ldrb	w0, [x0]   ; *(pint+8) = pint+sizeof(int)*2 = (pint+2)
  54:	2a0003e1 	mov	w1, w0
  58:	90000000 	adrp	x0, 0 <point_1>
  5c:	91000000 	add	x0, x0, #0x0
  60:	94000000 	bl	0 <printf>

    return 0;
  64:	52800000 	mov	w0, #0x0                   	// #0
}
  68:	a8c27bfd 	ldp	x29, x30, [sp], #32
  6c:	d65f03c0 	ret

0000000000000070 <point_2>:

void point_2()
{
  70:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  74:	910003fd 	mov	x29, sp
	char *str = "abcdef";
  78:	90000000 	adrp	x0, 0 <point_1>
  7c:	91000000 	add	x0, x0, #0x0
  80:	f9000fa0 	str	x0, [x29, #24] ; str

	printf("%s\n", str);
  84:	f9400fa0 	ldr	x0, [x29, #24] ; str
  88:	94000000 	bl	0 <puts>

	//*str = "fedcba";	// error : 单个字符赋值
	str = "fedcba";	   
  8c:	90000000 	adrp	x0, 0 <point_1>
  90:	91000000 	add	x0, x0, #0x0
  94:	f9000fa0 	str	x0, [x29, #24] ; str
	printf("%s\n", str);  // xxfedcba
  98:	f9400fa0 	ldr	x0, [x29, #24]
  9c:	94000000 	bl	0 <puts>

	//str[2] = 'C';		//修改第三个字符为大写		Segmentation fault
	//printf("%s\n", str);
}
  a0:	d503201f 	nop
  a4:	a8c27bfd 	ldp	x29, x30, [sp], #32
  a8:	d65f03c0 	ret

00000000000000ac <estimate_mode>:


static char *estimate_mode(unsigned short *pmode)
{
  ac:	d10083ff 	sub	sp, sp, #0x20
  b0:	f90007e0 	str	x0, [sp, #8]   ; pmode
	char *msg = 0;
  b4:	f9000fff 	str	xzr, [sp, #24] ; msg

	if (*pmode == 0x00) {
  b8:	f94007e0 	ldr	x0, [sp, #8] ; pmode
  bc:	79400000 	ldrh	w0, [x0] ; *pmode
  c0:	7100001f 	cmp	w0, #0x0
  c4:	540000a1 	b.ne	d8 <estimate_mode+0x2c>  // b.any
		msg = "Standby";
  c8:	90000000 	adrp	x0, 0 <point_1>
  cc:	91000000 	add	x0, x0, #0x0 ; variable value
  d0:	f9000fe0 	str	x0, [sp, #24] ; msg
  d4:	14000010 	b	114 <estimate_mode+0x68>
	}
	else if (*pmode == 0x01) {
  d8:	f94007e0 	ldr	x0, [sp, #8]
  dc:	79400000 	ldrh	w0, [x0] ; *pmode
  e0:	7100041f 	cmp	w0, #0x1
  e4:	540000a1 	b.ne	f8 <estimate_mode+0x4c>  // b.any
		msg = "Working";
  e8:	90000000 	adrp	x0, 0 <point_1>
  ec:	91000000 	add	x0, x0, #0x0
  f0:	f9000fe0 	str	x0, [sp, #24]
  f4:	14000008 	b	114 <estimate_mode+0x68>
	}
	else if (*pmode == 0x02) {
  f8:	f94007e0 	ldr	x0, [sp, #8]
  fc:	79400000 	ldrh	w0, [x0]
 100:	7100081f 	cmp	w0, #0x2
 104:	54000081 	b.ne	114 <estimate_mode+0x68>  // b.any
		msg = "Error";
 108:	90000000 	adrp	x0, 0 <point_1>
 10c:	91000000 	add	x0, x0, #0x0
 110:	f9000fe0 	str	x0, [sp, #24]
	}

	return msg;
 114:	f9400fe0 	ldr	x0, [sp, #24]
}
 118:	910083ff 	add	sp, sp, #0x20
 11c:	d65f03c0 	ret

0000000000000120 <main>:


int main()
{
 120:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
 124:	910003fd 	mov	x29, sp
	short i = 0;
 128:	79003fbf 	strh	wzr, [x29, #30] ; i

	point_1();
 12c:	94000000 	bl	0 <point_1>
	point_2();	
 130:	94000000 	bl	70 <point_2>
	printf("%s\n", estimate_mode(&i));
 134:	91007ba0 	add	x0, x29, #0x1e
 138:	97ffffdd 	bl	ac <estimate_mode>
 13c:	94000000 	bl	0 <puts>
	
	return 0;
 140:	52800000 	mov	w0, #0x0                   	// #0
}
 144:	a8c27bfd 	ldp	x29, x30, [sp], #32
 148:	d65f03c0 	ret
